<?php
$grades=array(
    array(
        'value'=>(date('Y')-1).'-09-01',
        'name'=>'一年级'
    ),array(
        'value'=>(date('Y')-2).'-09-01',
        'name'=>'二年级'
    ),array(
        'value'=>(date('Y')-3).'-09-01',
        'name'=>'三年级'
    ),array(
        'value'=>(date('Y')-4).'-09-01',
        'name'=>'四年级'
    ),array(
        'value'=>(date('Y')-5).'-09-01',
        'name'=>'五年级'
    ),array(
        'value'=>(date('Y')-6).'-09-01',
        'name'=>'六年级'
    ),array(
        'value'=>(date('Y')-7).'-09-01',
        'name'=>'初一'
    ),array(
        'value'=>(date('Y')-8).'-09-01',
        'name'=>'初二'
    ),array(
        'value'=>(date('Y')-9).'-09-01',
        'name'=>'初三'
    )
);
?>
<div class="table-responsive">
    <table class="table table-bordered table-hover">
        <thead>
        <tr>
            <td class="text-left">姓名</td>
            <td class="text-left">年级</td>
            <td class="text-left">学校</td>
            <td class="text-left">出生日期</td>
        </tr>
        </thead>
        <tbody>
        <?php if ($childs) { ?>
            <?php foreach ($childs as $child) { ?>
                <tr>
                    <td class="text-left"><?php echo $child['name']; ?></td>
                    <td class="text-left">
                        <?php foreach ($grades as $grade) {?>
                            <?php if($child['grade']==$grade['value']) {?>
                                <?php echo $grade['name'] ;?>
                            <?php }?>
                        <?php }?>
                    </td>
                    <td class="text-left"><?php echo $child['school']; ?></td>
                    <td class="text-left"><?php echo $child['birthday']; ?></td>
                </tr>
            <?php } ?>
        <?php } else { ?>
            <tr>
                <td class="text-center" colspan="4"><?php echo $text_no_results; ?></td>
            </tr>
        <?php } ?>
        </tbody>
    </table>
</div>
<div class="row">
    <div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
    <div class="col-sm-6 text-right"><?php echo $results; ?></div>
</div>